From d34501c219cda4b493a50b2a2abde7955e0bcf1f Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Sat, 4 Mar 2006 19:12:37 +0100 Subject: [PATCH] Log the tdb_error when a read fails with EIO. This is happening after a long time under load -- hopefully this message will suggest why. Signed-off-by: Ewan Mellor --- tools/xenstore/xenstored_core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index 24fbf57805..b23aa40fa5 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -406,16 +406,19 @@ static struct node *read_node(struct connection *conn, const char *name) TDB_DATA key, data; uint32_t *p; struct node *node; + TDB_CONTEXT * context = tdb_context(conn); key.dptr = (void *)name; key.dsize = strlen(name); - data = tdb_fetch(tdb_context(conn), key); + data = tdb_fetch(context, key); if (data.dptr == NULL) { - if (tdb_error(tdb_context(conn)) == TDB_ERR_NOEXIST) + if (tdb_error(context) == TDB_ERR_NOEXIST) errno = ENOENT; - else + else { + log("TDB error on read: %s", tdb_errorstr(context)); errno = EIO; + } return NULL; } -- 2.30.2